#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define CHAR_NUM 10

int main()
{
    char *pstr = malloc(CHAR_NUM+1);
    unsigned int len = CHAR_NUM;
   // int i = 0;
    //realloc
    char *k = "This is M\n";
     printf("n:%d , %d \n\r", len, strlen(k));
    strncpy(pstr, k, strlen(k));
    /*
    for(; i<=1000; i++) {
        len += CHAR_NUM;
        pstr = realloc(pstr, len);
        //puts(pstr);
        strncat(pstr, k, strlen(k));
    }

    puts(pstr);
    printf("n:%d , %d \n\r", len, strlen(pstr));
    */
    free(pstr);
    return 0;
}
